import pygame

from view.ui.GameUI import GameUI


class BlockImg:
    def __init__(self, img_path, x_position, y_position, multiple=1.5):
        self.location = [x_position, y_position]
        image = pygame.image.load(img_path)
        rect = image.get_rect()
        image = pygame.transform.scale(image, (int(rect.width * multiple), int(rect.height * multiple)))
        self.rect = image.get_rect()
        self.image = image
        GameUI.add_image_object(self)

    def update(self):
        self.rect.centerx = int(self.location[0] * 48 + 48 - self.rect.width // 2)
        self.rect.bottom = int(self.location[1] * 48 + 96 - self.rect.height)
